package com.hkbigdata;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author liuanbo
 * @creat 2024-03-20-0:03
 * @see 2194550857@qq.com
 */
public class HelloServlet2 extends HttpServlet {//alt+insert重新doget和dopost
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String method = req.getMethod();
        System.out.println("获取到的方法:"+method);
        System.out.println("get方法被调用了");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String method = req.getMethod();
        System.out.println("获取到的方法:"+method);
        System.out.println("post方法被调用了");
    }
}
